<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量的作用</title>
</head>
<body>
    <script>
    var name ='a';
    console.log(name);
    function f2(){
        document.write(name);
    }
    f2();

    function f1(){
        var a; 
        a = b = c = 9;
        document.write('a' + a);
        document.write('b' + b);
        document.write('c' + c);
    }
    f1();
    document.write('cc' + c);
    document.write('bb' + b);
    document.write('aa' + a);
    
    </script>
</body>
</html>